﻿Imports Mysoft.Map.Data

Partial Public Class Cwjk_PzRuleSet_OperType_Edit
    Inherits Mysoft.Map.Application.Security.AppPage

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            Dim strCwztGUID, strApplication, strHierarchyCode, strSQL, strParentCode, strParentOperType, strIsUsedScopeRepeat As String
            Dim dtOperTypeTable As System.Data.DataTable = New System.Data.DataTable()
            strCwztGUID = Request.QueryString("CwztGUID")
            strApplication = Request.QueryString("Application")
            strHierarchyCode = Request.QueryString("HierarchyCode")
            If Not strCwztGUID Is Nothing AndAlso strCwztGUID <> "" Then
                If Not strHierarchyCode Is Nothing AndAlso strHierarchyCode <> "" Then
                    strParentCode = strHierarchyCode.Substring(0, strHierarchyCode.LastIndexOf("."))
                Else
                    strParentCode = ""
                End If

                strSQL = "SELECT OperType,IsUsedScopeRepeat FROM p_CwjkOperType WHERE CwztGUID = '" & strCwztGUID & "' AND HierarchyCode= '" & strParentCode & "'"
                dtOperTypeTable = MyDB.GetDataTable(strSQL)
                If dtOperTypeTable.Rows.Count > 0 Then
                    strParentOperType = dtOperTypeTable.Rows(0).Item("OperType").ToString()
                    strIsUsedScopeRepeat = dtOperTypeTable.Rows(0).Item("IsUsedScopeRepeat").ToString()
                End If


                Me.txtApplication.Text = strApplication
                Me.txtCwztGUID.Text = strCwztGUID
                Me.txtParentCode.Text = strParentCode
                Me.txtIsUsedScopeRepeat.Text = strIsUsedScopeRepeat
                Me.txtParentOperType.Value = strParentOperType

            End If

        End If
    End Sub

End Class